import { createRouter, createWebHistory } from 'vue-router'
import login from '@/views/main/login.vue'

import childHome from '@/views/child/childHome.vue'
import childJob from '@/views/child/childJob.vue'
import childEnterprise from '@/views/child/childEnterprise.vue'
import childAbout from '@/views/child/childAbout.vue'
// const router = createRouter({
//   history: createWebHistory(import.meta.env.BASE_URL),
//   routes: [
//     {
//       path: '/main/login',
//       name: 'login',
//       // route level code-splitting
//       // this generates a separate chunk (About.[hash].js) for this route
//       // which is lazy-loaded when the route is visited.
//       component: () => import('@/views/main/login.vue')
//     }
//   ]
// })

const routes = [
  {
    path: '/main/login',
    name: 'login',
    meta: {
      title: '',
      keepAlive: false
    },
    component: login
  },
  {
    path: '/main/childHome',
    name: 'childHome',
    meta: {
      title: '',
      keepAlive: false
    },
    component: childHome
  },
  {
    path: '/main/childJob',
    name: 'childJob',
    meta: {
      title: '',
      keepAlive: false
    },
    component: childJob
  },
  {
    path: '/main/childEnterprise',
    name: 'childEnterprise',
    meta: {
      title: '',
      keepAlive: false
    },
    component: childEnterprise
  },
  {
    path: '/main/childAbout',
    name: 'childAbout',
    meta: {
      title: '',
      keepAlive: false
    },
    component: childAbout
  }
]
const router = createRouter({
  history: createWebHistory(),  //mode: 'history' // 使用history模式
  routes           // 路由配置
})



export default router
